<%= error_messages_for 'user' %>

<div id="instruction">
	<ul>
		<li><u>Site</u>: This is organization you are most closely affiliated with.  Managers associated with this site will be the ones to approve if your application can move forward for consideration.</li>
		<li><u>Postion</u>: Your job title or place in the organization.</li>		
	</ul>
</div>


<!--[form:user]-->
<p><label for="user_email">Email</label><br/>
<%= text_field 'user', 'email', (current_user.is_admin? ? {} : { :disabled => 1 })  %></p>           

<p><label for="user_login">First Name</label><br/>
<%= text_field 'user', 'first_name'  %></p>        

<p><label for="user_login">Last Name</label><br/>
<%= text_field 'user', 'last_name'  %></p>     

<p><label for="user_site_id">Site</label><br/>
<%= select("user", "site_id", Site.find(:all).collect {|p| [ p.name, p.id ] }, {:include_blank => true}) %></p>  

<p><label for="user_login">Position</label><br/>
<%= text_field 'user', 'position'  %></p>
 
<p><label for="user_login">Work Phone</label><br/>
<%= text_field 'user', 'work_phone'  %></p>

<% if current_user.is_admin? -%>  

<div id="instruction">
	<ul>
		<b>Assign a role</b>	<br />
		<li><u>Admin</u>: Can manage this site, it's users and make grant changes and approvals.</li>
		<li><u>Manager</u>: Usually, direct managers of individuals seeking grants.</li>
		<li><u>Judge</u>: Can rate/score grants to help determine who wins the grant.</li>		
		<li><u>Seeker</u>: Applicant for a grant.</li>		
		
	</ul>
	
</div>

  <p><label for="user_login">Role</label><br/>	
	
  <table border="1" cellspacing="2" cellpadding="2" width="30%">
	  <tr><th width="5%">Selection</th><th align="left" width="25%">Name</th></tr>
	 
	<% Role.find(:all).each do |g| -%>
	   <tr>
	   <td>
	   <input type="checkbox" name="user[role_ids][]" 
	          value="<%= g.id %>" 
	          <% if @user.roles.include?(g) %> checked="checked" 
	    <% end %> />
	    </td>
	    <td>
	<%= g.name %></td></tr>
	<% end -%>       
	</table>
	 
<% else -%>
<% end -%>

<!--[eoform:user]--> 